home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / graphics / picscrol.frm < prev    next >
Text File  |  1993-05-16  |  2KB  |  87 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Picture Scroll Demonstration"
  5.    ClientHeight    =   3720
  6.    ClientLeft      =   1095
  7.    ClientTop       =   1485
  8.    ClientWidth     =   4425
  9.    Height          =   4125
  10.    Left            =   1035
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   3720
  14.    ScaleWidth      =   4425
  15.    Top             =   1140
  16.    Width           =   4545
  17.    Begin PictureBox Picture1 
  18.       Height          =   3255
  19.       Left            =   120
  20.       ScaleHeight     =   3225
  21.       ScaleWidth      =   3945
  22.       TabIndex        =   0
  23.       Top             =   120
  24.       Width           =   3975
  25.       Begin PictureBox Picture2 
  26.          AutoSize        =   -1  'True
  27.          BorderStyle     =   0  'None
  28.          Height          =   7200
  29.          Left            =   -1800
  30.          Picture         =   PICSCROL.FRX:0000
  31.          ScaleHeight     =   7200
  32.          ScaleWidth      =   9600
  33.          TabIndex        =   1
  34.          Top             =   -960
  35.          Width           =   9600
  36.       End
  37.    End
  38.    Begin VScrollBar VScroll1 
  39.       Height          =   3255
  40.       Left            =   4080
  41.       SmallChange     =   10
  42.       TabIndex        =   3
  43.       Top             =   120
  44.       Width           =   255
  45.    End
  46.    Begin HScrollBar HScroll1 
  47.       Height          =   255
  48.       Left            =   120
  49.       SmallChange     =   10
  50.       TabIndex        =   2
  51.       Top             =   3360
  52.       Width           =   3975
  53.    End
  54. End
  55.  
  56. Sub Form_Load ()
  57.     picture2_change
  58. End Sub
  59.  
  60. Sub HScroll1_Change ()
  61.     picture2.left = picture1.left - hscroll1.value
  62. End Sub
  63.  
  64. Sub picture2_change ()
  65.     vscroll1.min = picture1.top
  66.     hscroll1.min = picture1.left
  67.  
  68.     vscroll1.max = picture2.height - picture1.height
  69.     
  70.     If vscroll1.max < vscroll1.min Then
  71.         vscroll1.max = vscroll1.min
  72.     End If
  73.     
  74.     hscroll1.max = picture2.width - picture1.width
  75.     If hscroll1.max < hscroll1.min Then
  76.         hscroll1.max = hscroll1.min
  77.     End If
  78.     
  79.     vscroll1.LargeChange = picture2.height / 10
  80.     hscroll1.LargeChange = picture2.width / 10
  81. End Sub
  82.  
  83. Sub VScroll1_Change ()
  84.     picture2.top = picture1.top - vscroll1.value
  85. End Sub
  86.  
  87.